package com.dawn.trademanage.bean;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.dawn.usermanage.bean.UserBean;

/**
 * The persistent class for the tt_tradeinfo database table.
 * 
 */
@Entity
@Table(name = "tt_tradeinfo")
public class TradeInfoBean implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private int tradeId;

    @Temporal(TemporalType.TIMESTAMP)
    private Date beginTime;

    private byte isOver;

    private int remainingSum;

    private int tradePrice;

    private int unitPrice;

    private int creditRate;

    // bi-directional many-to-one association to TradedetailBean
    @OneToMany(mappedBy = "ttTradeinfo")
    private Set<TradeDetailBean> ttTradedetails;

    // bi-directional many-to-one association to UserinfoBean
    @ManyToOne
    @JoinColumn(name = "TU_userID")
    private UserBean tuUserinfo;

    public int getTradeId() {
        return this.tradeId;
    }

    public void setTradeID(int tradeId) {
        this.tradeId = tradeId;
    }

    public Date getBeginTime() {
        return this.beginTime;
    }

    public void setBeginTime(Date beginTime) {
        this.beginTime = beginTime;
    }

    public byte getIsOver() {
        return this.isOver;
    }

    public void setIsOver(byte isOver) {
        this.isOver = isOver;
    }

    public int getRemainingSum() {
        return this.remainingSum;
    }

    public void setRemainingSum(int remainingSum) {
        this.remainingSum = remainingSum;
    }

    public int getTradePrice() {
        return this.tradePrice;
    }

    public void setTradePrice(int tradePrice) {
        this.tradePrice = tradePrice;
    }

    public int getUnitPrice() {
        return this.unitPrice;
    }

    public void setUnitPrice(int unitPrice) {
        this.unitPrice = unitPrice;
    }

    public Set<TradeDetailBean> getTtTradedetails() {
        return this.ttTradedetails;
    }

    public void setTtTradedetails(Set<TradeDetailBean> ttTradedetails) {
        this.ttTradedetails = ttTradedetails;
    }

    public UserBean getTuUserinfo() {
        return this.tuUserinfo;
    }

    public void setTuUserinfo(UserBean tuUserinfo) {
        this.tuUserinfo = tuUserinfo;
    }

    public int getCreditRate() {
        return creditRate;
    }

    public void setCreditRate(int creditRate) {
        this.creditRate = creditRate;
    }
}
